<?php 
include_once('connection/connection.php');
//session_start();
//ob_start();
include('header.php');
include('menu.php');
include('config.php');
$check=$_SESSION['check'];
?>
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<link href="css/style_question.css" type="text/css" rel="stylesheet" />
<script language="javascript" src="js/ajaxFunction1.js"></script>
<script language="javascript" type="text/javascript" src="js/validate.js"></script>
<title>Questionnaire No.3</title>
</head>
<body>
<?php
if(isset($_POST['submit']))
{
		$fclick = true;
		$loc_id = $_SESSION['loc_id'];
		$baw_no=$_POST['baw_no'];
		$well_no=$_POST['well_no'];
		$tanka_no=$_POST['tanka_no'];
		$house_tanka_no=$_POST['house_tanka_no'];
		$pucca_no=$_POST['pucca_no'];
		$kachha_no=$_POST['kachha_no'];
		$canal_no=$_POST['canal_no'];
		$toilet=$_POST['toilet'];
		$sep_toilet=$_POST['sep_toilet'];
		if($_POST['baw_no']!=0 || $_POST['baw_no']!='' || $_POST['well_no']!=0 || $_POST['well_no']!='' || $_POST['tanka_no']!=0 || $_POST['tanka_no']!='' || $_POST['house_tanka_no']!=0 || $_POST['house_tanka_no']!='' || $_POST['pucca_no']!=0 || $_POST['pucca_no']!='' || $_POST['kachha_no']!=0 || $_POST['kachha_no']!='' || $_POST['canal_no']!=0 || $_POST['canal_no']!='')
		{
			$qr1="UPDATE tbl_dtls_q3_loc SET baw_no = '$baw_no', well_no = '$well_no', tanka_no = '$tanka_no', house_tanka_no = '$house_tanka_no', pucca_no = '$pucca_no', kachha_no = '$kachha_no', canal_no = '$canal_no', toilet = '$toilet', sep_toilet = '$toilet' WHERE id='$loc_id'";	
			$result1=mysql_query($qr1);
			if($result1)
			{
				//echo "Success...............3";
				header('Location: questionnaire3_7.php');	
			}
			for($i=1; $i<=$baw_no; $i++)
			{
			$baw_id='baw_id'.$i;
			$baw_location='baw_location'.$i;
			$baw_longitude='baw_longitude'.$i;
			$baw_latitude='baw_latitude'.$i;
			$baw_op_status='baw_op_status'.$i;
			$baw_method='baw_method'.$i;
			$baw_rain_water='baw_rain_water'.$i;
			$baw_month='baw_month'.$i;
			$baw_approx_cap='baw_approx_cap'.$i;
			$baw_id=$_POST[$baw_id];
			$baw_location=$_POST[$baw_location];
			$baw_longitude=$_POST[$baw_longitude];
			$baw_latitude=$_POST[$baw_latitude];
			$baw_op_status=$_POST[$baw_op_status];
			$baw_method=$_POST[$baw_method];
			$baw_rain_water=$_POST[$baw_rain_water];
			$baw_month=$_POST[$baw_month];
			$baw_approx_cap=$_POST[$baw_approx_cap];	
			$qr2="INSERT INTO tbl_dtls_q3_traditional_src(loc_id, trad_id, trad_location, trad_longitude, trad_latitude, trad_op_status, trad_method, trad_rain_water, trad_month, trad_approx_cap) Values ('$loc_id', '$baw_id', '$baw_location', '$baw_longitude', '$baw_latitude', '$baw_op_status', '$baw_method', '$baw_rain_water', '$baw_month', '$baw_approx_cap')";   	
			$result2=mysql_query($qr2);
			}
			if($result2)
			{
				//echo "Success...............3";
				header('Location: questionnaire3_7.php');	
			}
			for($i=1; $i<=$well_no; $i++)
			{
			$well_id='well_id'.$i;
			$well_location='well_location'.$i;
			$well_longitude='well_longitude'.$i;
			$well_latitude='well_latitude'.$i;
			$well_op_status='well_op_status'.$i;
			$well_method='well_method'.$i;
			$well_rain_water='well_rain_water'.$i;
			$well_month='well_month'.$i;
			$well_approx_cap='well_approx_cap'.$i;
			$well_id=$_POST[$well_id];
			$well_location=$_POST[$well_location];
			$well_longitude=$_POST[$well_longitude];
			$well_latitude=$_POST[$well_latitude];
			$well_op_status=$_POST[$well_op_status];
			$well_method=$_POST[$well_method];
			$well_rain_water=$_POST[$well_rain_water];
			$well_month=$_POST[$well_month];
			$well_approx_cap=$_POST[$well_approx_cap];
			$qr3="INSERT INTO tbl_dtls_q3_traditional_src(loc_id, trad_id, trad_location, trad_longitude, trad_latitude, trad_op_status, trad_method, trad_rain_water, trad_month, trad_approx_cap) Values ('$loc_id', '$well_id', '$well_location', '$well_longitude', '$well_latitude', '$well_op_status', '$well_method', '$well_rain_water', '$well_month', '$well_approx_cap')";
			$result3=mysql_query($qr3);
			}
			if($result3)
			{
				//echo "Success...............3";
				header('Location: questionnaire3_7.php');	
			}
			for($i=1; $i<=$tanka_no; $i++)
			{
			$tanka_id='tanka_id'.$i;
			$tanka_location='tanka_location'.$i;
			$tanka_longitude='tanka_longitude'.$i;
			$tanka_latitude='tanka_latitude'.$i;
			$tanka_op_status='tanka_op_status'.$i;
			$tanka_method='tanka_method'.$i;
			$tanka_rain_water='tanka_rain_water'.$i;
			$tanka_month='tanka_month'.$i;
			$tanka_approx_cap='tanka_approx_cap'.$i;
			$tanka_id=$_POST[$tanka_id];
			$tanka_location=$_POST[$tanka_location];
			$tanka_longitude=$_POST[$tanka_longitude];
			$tanka_latitude=$_POST[$tanka_latitude];
			$tanka_op_status=$_POST[$tanka_op_status];
			$tanka_method=$_POST[$tanka_method];
			$tanka_rain_water=$_POST[$tanka_rain_water];
			$tanka_month=$_POST[$tanka_month];
			$tanka_approx_cap=$_POST[$tanka_approx_cap];
			$qr4="INSERT INTO tbl_dtls_q3_traditional_src(loc_id, trad_id, trad_location, trad_longitude, trad_latitude, trad_op_status, trad_method, trad_rain_water, trad_month, trad_approx_cap) Values ('$loc_id', '$tanka_id', '$tanka_location', '$tanka_longitude', '$tanka_latitude', '$tanka_op_status', '$tanka_method', '$tanka_rain_water', '$tanka_month', '$tanka_approx_cap')";    	
			$result4=mysql_query($qr4);
			}
			if($result4)
			{
				//echo "Success...............3";
				header('Location: questionnaire3_7.php');	
			}
			for($i=1; $i<=$house_tanka_no; $i++)
			{
			$htanka_id='htanka_id'.$i;
			$htanka_location='htanka_location'.$i;
			$htanka_longitude='htanka_longitude'.$i;
			$htanka_latitude='htanka_latitude'.$i;
			$htanka_op_status='htanka_op_status'.$i;
			$htanka_method='htanka_method'.$i;
			$htanka_rain_water='htanka_rain_water'.$i;
			$htanka_month='htanka_month'.$i;
			$htanka_approx_cap='htanka_approx_cap'.$i;
			$htanka_id=$_POST[$htanka_id];
			$htanka_location=$_POST[$htanka_location];
			$htanka_longitude=$_POST[$htanka_longitude];
			$htanka_latitude=$_POST[$htanka_latitude];
			$htanka_op_status=$_POST[$htanka_op_status];
			$htanka_method=$_POST[$htanka_method];
			$htanka_rain_water=$_POST[$htanka_rain_water];
			$htanka_month=$_POST[$htanka_month];
			$htanka_approx_cap=$_POST[$htanka_approx_cap];
			$qr5="INSERT INTO tbl_dtls_q3_traditional_src(loc_id, trad_id, trad_location, trad_longitude, trad_latitude, trad_op_status, trad_method, trad_rain_water, trad_month, trad_approx_cap) Values ('$loc_id', '$htanka_id', '$htanka_location', '$htanka_longitude', '$htanka_latitude', '$htanka_op_status', '$htanka_method', '$htanka_rain_water', '$htanka_month', '$htanka_approx_cap')";    	
			$result5=mysql_query($qr5);
			}
			if($result5)
			{
				//echo "Success...............3";
				header('Location: questionnaire3_7.php');	
			}
			for($i=1; $i<=$pucca_no; $i++)
			{
			$pucca_id='pucca_id'.$i;
			$pucca_location='pucca_location'.$i;
			$pucca_longitude='pucca_longitude'.$i;
			$pucca_latitude='pucca_latitude'.$i;
			$pucca_op_status='pucca_op_status'.$i;
			$pucca_method='pucca_method'.$i;
			$pucca_rain_water='pucca_rain_water'.$i;
			$pucca_month='pucca_month'.$i;
			$pucca_approx_cap='pucca_approx_cap'.$i;
			$pucca_id=$_POST[$pucca_id];
			$pucca_location=$_POST[$pucca_location];
			$pucca_longitude=$_POST[$pucca_longitude];
			$pucca_latitude=$_POST[$pucca_latitude];
			$pucca_op_status=$_POST[$pucca_op_status];
			$pucca_method=$_POST[$baw_method];
			$pucca_rain_water=$_POST[$pucca_rain_water];
			$pucca_month=$_POST[$pucca_month];
			$pucca_approx_cap=$_POST[$pucca_approx_cap];
			$qr6="INSERT INTO tbl_dtls_q3_traditional_src(loc_id, trad_id, trad_location, trad_longitude, trad_latitude, trad_op_status, trad_method, trad_rain_water, trad_month, trad_approx_cap) Values ('$loc_id', '$pucca_id', '$pucca_location', '$pucca_longitude', '$pucca_latitude', '$pucca_op_status', '$pucca_method', '$pucca_rain_water', '$pucca_month', '$pucca_approx_cap')";    	
			$result6=mysql_query($qr6);
			}
			if($result6)
			{
				//echo "Success...............3";
				header('Location: questionnaire3_7.php');	
			}
			for($i=1; $i<=$kachha_no; $i++)
			{
			$kachha_id='kachha_id'.$i;
			$kachha_location='kachha_location'.$i;
			$kachha_longitude='kachha_longitude'.$i;
			$kachha_latitude='kachha_latitude'.$i;
			$kachha_op_status='kachha_op_status'.$i;
			$kachha_method='kachha_method'.$i;
			$kachha_rain_water='kachha_rain_water'.$i;
			$kachha_month='kachha_month'.$i;
			$kachha_approx_cap='kachha_approx_cap'.$i;
			$kachha_id=$_POST[$kachha_id];
			$kachha_location=$_POST[$kachha_location];
			$kachha_longitude=$_POST[$kachha_longitude];
			$kachha_latitude=$_POST[$kachha_latitude];
			$kachha_op_status=$_POST[$kachha_op_status];
			$kachha_method=$_POST[$kachha_method];
			$kachha_rain_water=$_POST[$kachha_rain_water];
			$kachha_month=$_POST[$kachha_month];
			$kachha_approx_cap=$_POST[$kachha_approx_cap];
			$qr7="INSERT INTO tbl_dtls_q3_traditional_src(loc_id, trad_id, trad_location, trad_longitude, trad_latitude, trad_op_status, trad_method, trad_rain_water, trad_month, trad_approx_cap) Values ('$loc_id', '$kachha_id', '$kachha_location', '$kachha_longitude', '$kachha_latitude', '$kachha_op_status', '$kachha_method', '$kachha_rain_water', '$kachha_month', '$kachha_approx_cap')";    	
			$result7=mysql_query($qr7);
			}
			if($result7)
			{
				//echo "Success...............3";
				header('Location: questionnaire3_7.php');	
			}
			for($i=1; $i<=$canal_no; $i++)
			{
			$canal_id='canal_id'.$i;
			$canal_location='canal_location'.$i;
			$canal_longitude='canal_longitude'.$i;
			$canal_latitude='canal_latitude'.$i;
			$canal_op_status='canal_op_status'.$i;
			$canal_method='canal_method'.$i;
			$canal_rain_water='canal_rain_water'.$i;
			$canal_month='canal_month'.$i;
			$canal_approx_cap='canal_approx_cap'.$i;
			$canal_id=$_POST[$canal_id];
			$canal_location=$_POST[$canal_location];
			$canal_longitude=$_POST[$canal_longitude];
			$canal_latitude=$_POST[$canal_latitude];
			$canal_op_status=$_POST[$canal_op_status];
			$canal_method=$_POST[$canal_method];
			$canal_rain_water=$_POST[$canal_rain_water];
			$canal_month=$_POST[$canal_month];
			$canal_approx_cap=$_POST[$canal_approx_cap];
			$qr8="INSERT INTO tbl_dtls_q3_traditional_src(loc_id, trad_id, trad_location, trad_longitude, trad_latitude, trad_op_status, trad_method, trad_rain_water, trad_month, trad_approx_cap) Values ('$loc_id', '$canal_id', '$canal_location', '$canal_longitude', '$canal_latitude', '$canal_op_status', '$canal_method', '$canal_rain_water', '$canal_month', '$canal_approx_cap')";    	
			$result8=mysql_query($qr8);
			}
			if($result8)
			{
				//echo "Success...............3";
				header('Location: questionnaire3_7.php');	
			}
		}
		else if($_POST['baw_no']=='0' || $_POST['well_no']=='0' || $_POST['tanka_no']=='0' || $_POST['house_tanka_no']=='0' || $_POST['pucca_no']=='0' || $_POST['kachha_no']=='0' || $_POST['canal_no']=='0')
		{
			$qr1="UPDATE tbl_dtls_q3_loc SET baw_no = '$baw_no', well_no = '$well_no', tanka_no = '$tanka_no', house_tanka_no = '$house_tanka_no', pucca_no = '$pucca_no', kachha_no = '$kachha_no', canal_no = '$canal_no', toilet = '$toilet', sep_toilet = '$toilet' WHERE id='$loc_id'";	
			$result1=mysql_query($qr1);
			if($result1)
			{
				//echo "Success...............3";
				header('Location: questionnaire3_7.php');	
			}
		}			
			$rows_num = $_SESSION['rows_num'];
			for($i=1; $i<=$rows_num; $i++)
			{
			$habit_name='habit_name'.$i;
			$habit_code='habit_code'.$i;
			$type_habit='type_habit'.$i;
			$body_supply='body_supply'.$i;
			$time_supply='time_supply'.$i;
			$type_tanker='type_tanker'.$i;
			$freq_day='freq_day'.$i;
			$reason_tanker_supply='reason_tanker_supply'.$i;
			$population_served='population_served'.$i;
			$habit_name=$_POST[$habit_name];
			$habit_code=$_POST[$habit_code];
			$type_habit=$_POST[$type_habit];
			$body_supply=$_POST[$body_supply];
			$time_supply=$_POST[$time_supply];
			$type_tanker=$_POST[$type_tanker];
			$freq_day=$_POST[$freq_day];
			$reason_tanker_supply=$_POST[$reason_tanker_supply];
			$population_served=$_POST[$population_served];
			
			$qr9="INSERT INTO tbl_dtls_q3_tanker_supply(loc_id, habit_name, habit_code, type_habit,  body_supply, time_supply, type_tanker, freq_supply_day, reason_tanker_supply, population_served) VALUES ('$loc_id', '$habit_name', '$habit_code', '$type_habit', '$body_supply', '$time_supply', '$type_tanker', '$freq_day', '$reason_tanker_supply', '$population_served')";
			$result9=mysql_query($qr9);
			}
			if($result9)
			{
				//echo "Success...............3";
				header('Location: questionnaire3_7.php');	
			}
			$priority1=$_POST['priority1'];
			$priority2=$_POST['priority2'];
			$priority3=$_POST['priority3'];
			$priority4=$_POST['priority4'];
			$priority5=$_POST['priority5'];
			$priority6=$_POST['priority6'];
			$priority7=$_POST['priority7'];
			$priority8=$_POST['priority8'];
			$priority9=$_POST['priority9'];
			$priority10=$_POST['priority10'];
			$priority11=$_POST['priority11'];
			$qr10="INSERT INTO tbl_dtls_q3_ranking(loc_id, not_suffic_water_available, quality_water_not_good, large_dist_travel, lmtd_water_supply, traditional_system_rejuvenated, handpump_needed, roof_water_harvest, water_through_ponds_req, water_facility_sc_st, water_supply_govt_school, water_supply_oh) VALUES ('$loc_id', '$priority1', '$priority2', '$priority3', '$priority4', '$priority5', '$priority6', '$priority7', '$priority8', '$priority9', '$priority10', '$priority11')";
			//echo $qr3;
			$result10=mysql_query($qr10);
			if($result10)
			{
				//echo "Success...............3";
				header('Location: questionnaire3_7.php');	
			}
		
}				
else
{
	$fclick = false;
	$flag=0;
}
?>		
<div align="center">
<form action="" method="post" enctype="multipart/form-data" name="questionnaire3_5" id="questionnaire3_6" onSubmit="return validate6()">
<input type="hidden" name="check_value" id="check_value" value="<?php echo $check;?>" class="txt5">
	<table border="0" width="100%" id="table1" cellspacing="1" cellpadding="0">
		<tr>
			<td height="30" colspan="2">
			<p align="center">
			<font face="Verdana" style="font-size: 10pt; font-weight: 700" color="#000000">
			Questionnaire No. 3</font></p></td>
		</tr>
		<tr>
			<td height="19" colspan="2">
			<p align="center">
			<font face="Arial" style="font-size: 8.5pt" color="#000000">For 
			Field Survey (Village Level questionnaire) </font></p></td>
		</tr>
		<tr>
			<td height="18" colspan="2">
			<p align="center">
			<font style="font-size: 8.5pt" face="Arial" color="#000000">Page 6</font></p></td>
		</tr>
		<tr>
			<td colspan="2">&nbsp;</td>
		</tr>
		<tr>
			<td height="22" colspan="2" bgcolor="#EEEEEE"><font color="#000000">
			<span style="font-weight: 700">
			<font face="Arial" style="font-size: 8.5pt">&nbsp; 11.&nbsp; 
			Traditional Sources</font></span></font></td>
  		</tr>
		<tr>
			<td height="22" width="153" bgcolor="#F7E6B7">
			<font style="font-size: 8.5pt" face="Verdana" color="#990000">
			&nbsp;Source Type</font></td>
			<td height="22" width="822" bgcolor="#F7E6B7">
			<font style="font-size: 8.5pt" face="Verdana" color="#990000">					
			&nbsp;Total Nos.</font></td>
		</tr>
		<tr>
			<td height="22" width="153">
			<font style="font-size: 9pt" face="Verdana" color="#000000">
			&nbsp;Bawaries</font></td>
			<td width="822" height="22">
		  &nbsp;
		  <input type="text" name="baw_no" id="baw_no" size="20" class="txt5" onKeyUp="show_baw();numeric(this)"></td>
		</tr>
		<tr>
            <td colspan="2"><div id="bawarie"></div></td>
		</tr>
		<tr>
			<td height="22" width="153">
			<font style="font-size: 9pt" face="Verdana" color="#000000">
			&nbsp;Old Open Well</font></td>
	  	  <td width="822" height="22">
	  	  &nbsp;
	  	  <input type="text" name="well_no" id="well_no" size="20" class="txt5" onKeyUp="show_well();numeric(this)"></td>
		</tr>
		<tr>
            <td colspan="2"><div id="well"></div></td>
		</tr>
		<tr>
			<td height="22" width="153">
			<font style="font-size: 9pt" face="Verdana" color="#000000">
			&nbsp;Public Tankas</font></td>
			<td width="822" height="22">
	  	  &nbsp;
	  	  <input type="text" name="tanka_no" id="tanka_no" size="20" class="txt5" onKeyUp="show_pub_tankas();numeric(this)"></td>
		</tr>
		<tr>
            <td colspan="2"><div id="public_tanka"></div></td>
		</tr>
		<tr>
			<td height="22" width="153">
			<font style="font-size: 9pt" face="Verdana" color="#000000">
			&nbsp;House Hold Tankas</font></td>
			<td width="822" height="22">
		  &nbsp;
		  <input type="text" name="house_tanka_no" id="house_tanka_no" size="20" class="txt5" onKeyUp="show_house_takas();numeric(this)">           </td>
		</tr>
		<tr>
            <td colspan="2"><div id="house_tanka"></div></td>
		</tr>
		<tr>
			<td height="22" width="153">
			<font style="font-size: 9pt" face="Verdana" color="#000000">
			&nbsp;Ponds Pucca</font></td>
			<td width="822" height="22">
	  	  &nbsp;
	  	  <input type="text" name="pucca_no" id="pucca_no" size="20" class="txt5" onKeyUp="show_ponds_pucca();numeric(this)"></td>
		</tr>
		<tr>
            <td colspan="2"><div id="pond_pucca"></div></td>
		</tr>
		<tr>
			<td height="22" width="153">
			<font style="font-size: 9pt" face="Verdana" color="#000000">
			&nbsp;Ponds Kachha</font></td>
			<td width="822" height="22">
	  	  &nbsp;
	  	  <input type="text" name="kachha_no" id="kachha_no" size="20" class="txt5" onKeyUp="show_ponds_kachha();numeric(this)"></td>
		</tr>
		<tr>
            <td colspan="2"><div id="pond_kachha"></div></td>
		</tr>
		<tr>
			<td height="22" width="153">
			<font style="font-size: 9pt" face="Verdana" color="#000000">
			&nbsp;Canal Water Ponds</font></td>
			<td width="822" height="22">
	  	  &nbsp;
	  	  <input type="text" name="canal_no" id="canal_no" size="20" class="txt5" onKeyUp="show_canal();numeric(this)"></td>
		</tr>
		<tr>
            <td colspan="2"><div id="canal"></div></td>
		</tr>
		<tr>
			<td colspan="2">&nbsp;</td>
		</tr>
	</table>
		<table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#FDF9EE" id="table6">
            <tr>
			<td height="22" colspan="8" bgcolor="#EEEEEE"><font color="#000000">
			<span style="font-weight: 700">
			<font face="Arial" style="font-size: 8.5pt">&nbsp; 12.&nbsp; Tanker supply</font></span></font></td>
			</tr>
			<tr>
			<td width="145" height="23" bgcolor="#F7E6B7" align="center"><address>
                <font style="font-size: 8.5pt; font-style: normal" face="Verdana" color="#990000"> Habitation Name</font>
              </address>              </td> 
				<td align="center" width="56" rowspan="" valign="top" bgcolor="#F7E6B7">
					<address>
						<font style="font-size: 8.5pt; font-style: normal" face="Verdana" color="#990000">
			  Type MH/ OH</font></address>					</td>
              <td height="23" bgcolor="#F7E6B7" align="center" width="102"><address>
                <font style="font-size: 8.5pt; font-style: normal" face="Verdana" color="#990000"> Owned By</font>
              </address></td>
              <td height="23" bgcolor="#F7E6B7" align="center" colspan="0"><address>
                <font style="font-size: 8.5pt; font-style: normal" face="Verdana" color="#990000"> Time of Supply</font>
              </address></td>
              <td height="23" colspan="0" bgcolor="#F7E6B7" align="center"><address>
                <font style="font-size: 8.5pt; font-style: normal" face="Verdana" color="#990000"> Type of Tanker</font>
              </address></td>
              <td width="176" height="46" rowspan="0" bgcolor="#F7E6B7" align="center"><address>
                <font style="font-size: 8.5pt; font-style: normal" face="Verdana" color="#990000"> Frequency of supply per day (hr/day)</font>
              </address></td>
			  
              <td height="23" bgcolor="#F7E6B7" align="center" colspan="0"><address>
                <font style="font-size: 8.5pt; font-style: normal" face="Verdana" color="#990000"> Reason for tanker Supply</font>
              </address></td>
              <td height="23" bgcolor="#F7E6B7" align="center" colspan="0"><address>
                <font style="font-size: 8.5pt; font-style: normal" face="Verdana" color="#990000"> Population served </font>
              </address></td>
            </tr>
            <?php
				$hname=$_SESSION['arr_habit_name'];
				$hcode=$_SESSION['arr_habit_code'];
				$i=1;
				foreach($hname as $key=>$val)
				{
					?>
            <tr>
              <td width="145" align="center" cellspacing="1">
				<input type="text" name="habit_name<?php echo $i;?>" id="habit_name<?php echo $i;?>" value="<?php echo $hname[$i]['name'];?>" size="20" class="txt4" readonly />
				<input type="hidden" name="habit_code<?php echo $i;?>" id="habit_code<?php echo $i;?>" value= "<?php echo $hcode[$i]['code'];?>" size="20" class="txt4" /></td>
			  <td align="center" width="56">
			  <input type="text" name="type_habit<?php echo $i;?>" id="type_habit<?php echo $i;?>" value="<?php if($i==1){ echo "MH"; } else { echo "OH"; } ?>" size="2" class="txt_1" readonly/></td>
              <td width="102" align="center" cellspacing="1">
			  <select size="1" name="body_supply<?php echo $i;?>" id="body_supply<?php echo $i;?>" class="txt5">
                      <option selected value="0">Select</option>
                      <?php 
						foreach($body_to_supply as $key=>$val)
						{
		   					echo "<option value=\"$val\">$val</option>";
						}
					?>
              </select></td>
              <td width="97" align="center" cellspacing="1">
			  <select size="1" name="time_supply<?php echo $i;?>" id="time_supply<?php echo $i;?>" class="txt5">
                      <option selected value="0">Select</option>
                      <?php 
						foreach($time_supply as $key=>$val)
						{
		   					echo "<option value=\"$val\">$val</option>";
						}
					?>
              </select></td>
              <td width="98" align="center" cellspacing="1">
			  <select size="1" name="type_tanker<?php echo $i;?>" id="type_tanker<?php echo $i;?>" class="txt5">
                      <option selected value="0">Select</option>
                      <?php 
						foreach($tanker as $key=>$val)
						{
		   					echo "<option value=\"$val\">$val</option>";
						}
					?>
              </select></td>
              <td width="176" align="center" cellspacing="1">
			  <select size="1" name="freq_day<?php echo $i;?>" id="freq_day<?php echo $i;?>" class="txt5">
                      <option selected value="0">Select</option>
                      <?php 
						foreach($day as $key=>$val)
						{
		   					echo "<option value=\"$val\">$val</option>";
						}
					?>
              </select></td>
              <td align="center" width="148" cellspacing="1">
			  <select size="1" name="reason_tanker_supply<?php echo $i;?>" id="reason_tanker_supply<?php echo $i;?>" class="txt5">
                      <option selected value="0">Select</option>
                      <?php 
						foreach($reason as $key=>$val)
						{
		   					echo "<option value=\"$val\">$val</option>";
						}
					?>
              </select></td>
              <td align="center" width="131" cellspacing="1">
			  <select size="1" name="population_served<?php echo $i;?>" id="population_served<?php echo $i;?>" class="txt5">
                      <option selected value="0">Select</option>
                      <?php 
						foreach($population as $key=>$val)
						{
		   					echo "<option value=\"$val\">$val</option>";
						}
					?>
              </select></td>
            </tr>
            <?php  $i++;
				} ?>
		<tr>
			<td colspan="2">&nbsp;</td>
		</tr>
		</table>
		<table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#FDF9EE" id="table6">
		<tr>
			<td height="22" colspan="2" bgcolor="#EEEEEE"><font color="#000000">
			<span style="font-weight: 700">
			<font face="Arial" style="font-size: 8.5pt">&nbsp; 13.&nbsp; </font></span></font><span style="font-weight: 700">
			<font face="Arial" style="font-size: 8.5pt" color="#000000">Please 
			Rank the felt needs of community in the order of priority (for main 
			Village)</font></span></td>
		</tr>
		<tr>
			<td height="22" colspan="2" bgcolor="#EEEEEE">
			<span style="font-weight: 700">
			<font face="Arial" style="font-size: 8.5pt" color="#FF0000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Enter 1 to 11 in the boxes for ranking (priority)</font></span></td>
		</tr>
		<tr>
			<td colspan="2">
			<table border="0" width="100%" id="table8" cellpadding="0" bgcolor="#FDF9EE">
				<tr>
					<td width="70" align="center">
					<font style="font-size: 9pt" face="Arial" color="#000000">
					<input type="text" name="priority1" id="priority1" value="" class="txt5" onKeyUp="numeric(this)"></font></td>
					<td width="748">
					<font style="font-size: 9pt" face="Verdana" color="#000000">
					Not sufficient quantity of water available</font></td>
				</tr>
				<tr>
					<td width="70" align="center">
					<font style="font-size: 9pt" face="Arial" color="#000000">
					<input type="text" name="priority2" id="priority2" value="" class="txt5" onKeyUp="numeric(this)"></font></td>
					<td>
					<font style="font-size: 9pt" face="Verdana" color="#000000">
					Quality of water is not good for drinking</font></td>
				</tr>
				<tr>
					<td width="70" align="center">
					<font style="font-size: 9pt" face="Arial" color="#000000">
					<input type="text" name="priority3" id="priority3" value="" class="txt5" onKeyUp="numeric(this)"></font></td>
					<td>
					<font style="font-size: 9pt" face="Verdana" color="#000000">
					Large distance to travel</font></td>
				</tr>
				<tr>
					<td width="70" align="center">
					<font style="font-size: 9pt" face="Arial" color="#000000">
					<input type="text" name="priority4" id="priority4" value="" class="txt5" onKeyUp="numeric(this)"></font></td>
					<td>
					<font face="Verdana" style="font-size: 9pt" color="#000000">
					Very limited time to supply</font></td>
				</tr>
				<tr>
					<td width="70" align="center">
					<font style="font-size: 9pt" face="Arial" color="#000000">
					<input type="text" name="priority5" id="priority5" value="" class="txt5" onKeyUp="numeric(this)"></font></td>
					<td>
					<font style="font-size: 9pt" face="Verdana" color="#000000">
					Existing traditional system rejuvenated </font></td>
				</tr>
				<tr>
					<td width="70" align="center">
					<font style="font-size: 9pt" face="Arial" color="#000000">
					<input type="text" name="priority6" id="priority6" value="" class="txt5" onKeyUp="numeric(this)"></font></td>
					<td>
					<font face="Verdana" style="font-size: 9pt" color="#000000">
					More hand pumps are needed</font></td>
				</tr>
				<tr>
					<td width="70" align="center">
					<font style="font-size: 9pt" face="Arial" color="#000000">
					<input type="text" name="priority7" id="priority7" value="" class="txt5" onKeyUp="numeric(this)"></font></td>
					<td>
					<font style="font-size: 9pt" face="Verdana" color="#000000">
					Roof water Harvesting</font></td>
				</tr>
				<tr>
					<td width="70" align="center">
					<font style="font-size: 9pt" face="Arial" color="#000000">
					<input type="text" name="priority8" id="priority8" value="" class="txt5" onKeyUp="numeric(this)"></font>                    </td>
					<td>
					<font style="font-size: 9pt" face="Verdana" color="#000000">
					Water conservation through ponds is required</font></td>
				</tr>
				<tr>
					<td width="70" align="center">
					<font style="font-size: 9pt" face="Arial" color="#000000">
					<input type="text" name="priority9" id="priority9" value="" class="txt5" onKeyUp="numeric(this)"></font>                    </td>
					<td>
					<font style="font-size: 9pt" face="Verdana" color="#000000">
					Water facility in SC/ ST basti</font></td>
				</tr>
				<tr>
					<td width="70" align="center">
					<font style="font-size: 9pt" face="Arial" color="#000000">
					<input type="text" name="priority10" id="priority10" value="" class="txt5" onKeyUp="numeric(this)"></font>                    </td>
					<td>
					<font style="font-size: 9pt" face="Verdana" color="#000000">
					Water supply in govt school</font></td>
				</tr>
				<tr>
					<td width="70" align="center">
					<font style="font-size: 9pt" face="Arial" color="#000000">
					<input type="text" name="priority11" id="priority11" value="" class="txt5" onKeyUp="numeric(this)"></font>                    </td>
					<td>
					<font style="font-size: 9pt" face="Verdana" color="#000000">
					Water supply for other habitations </font></td>
				</tr>
			</table></td>
		</tr>
		<tr>
			<td colspan="2">&nbsp;</td>
		</tr>
		<tr>
			<td height="22" colspan="2" bgcolor="#EEEEEE"><font color="#000000">
			<span style="font-weight: 700">
			<font face="Arial" style="font-size: 8.5pt">&nbsp; 14 a).&nbsp; </font></span></font><span style="font-weight: 700">
			<font face="Arial" style="font-size: 8.5pt" color="#000000">Do the Schools & Anganvadis in the villages / Other Habitations you visit Toilet provisions: &nbsp;&nbsp;&nbsp; </font></span></td>
		</tr>
		<tr bgcolor="#FDF9EE">
			<td width="166">
				<font style="font-size: 8.5pt" face="Arial" color="#000000">
			  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		  <input type="radio" name="toilet" id="toilet" value="YES" checked="checked"/> Yes</font>			           	</td>
			<td width="805">
				<font style="font-size: 8.5pt" face="Arial" color="#000000">
		  		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  		  <input type="radio" name="toilet" id="toilet" value="NO" />No</font>		 	          </td>
		</tr>
		<tr><td colspan="2">&nbsp;</td></tr>
		<tr>
			<td height="24" colspan="2" bgcolor="#EEEEEE"><font color="#000000">
			<span style="font-weight: 700">
			<font face="Arial" style="font-size: 8.5pt">&nbsp; 14 b).&nbsp; </font></span></font><span style="font-weight: 700">
			<font face="Arial" style="font-size: 8.5pt" color="#000000">If Yes, Do they have seperate toilets for Boys and girls? &nbsp;&nbsp;&nbsp; </font></span>			</td>
		</tr>
		<tr bgcolor="#FDF9EE">
			<td><font style="font-size: 8.5pt" face="Arial" color="#000000">
			  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			  <input type="radio" name="sep_toilet" id="sep_toilet" value="YES"/> Yes</font></td>
			<td><font style="font-size: 8.5pt" face="Arial" color="#000000">
		  		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		  		<input type="radio" name="sep_toilet" id="sep_toilet" value="NO" />No</font>			</td>
		</tr>
		<tr><td colspan="2">&nbsp;</td></tr>
		<tr>
			<td colspan="2">
			<p align="center">
			<input type="submit" value="Click for Continue" name="submit" style="font-size: 8pt; font-family: Verdana; border-style: solid; border-width: 1px"></td>
		</tr>
		<tr>
			<td colspan="2">&nbsp;</td>
		</tr>
		
</table>
</form>
</div>

</body>
</html>